package cn.yunhe.dao.impl;

import cn.yunhe.dao.IDeptDao;
import cn.yunhe.model.Dept;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("deptDao")
public class DeptDaoImpl extends HibernateDaoSupport implements IDeptDao {

    public List<Dept> queryAllDept() {
        return getHibernateTemplate().find("from Dept");
    }

    public void addDept(Dept dept) {
        getHibernateTemplate().save(dept);
    }

    public void delDept(Dept dept) {
        getHibernateTemplate().delete(dept);
    }


}
